package com.jz.community.moduleshoppingguide.home.net;

import com.jz.community.basecomm.constant.Constant;
import com.jz.community.moduleshoppingguide.home.bean.CategoriesGoodsBean;
import com.jz.community.moduleshoppingguide.home.bean.ChunnelCategoriesBean;
import com.jz.community.moduleshoppingguide.home.bean.ChunnelNewbornBean;
import com.jz.community.moduleshoppingguide.home.bean.ChunnelTypeBean;
import com.jz.community.moduleshoppingguide.home.bean.HomeFindBean;
import com.jz.community.moduleshoppingguide.home.bean.HomeRecommendBean;
import com.jz.community.moduleshoppingguide.home.bean.HotSaleAllBean;
import com.jz.community.moduleshoppingguide.home.bean.HotSaleShowBean;
import com.jz.community.moduleshoppingguide.home.bean.LimitGoodsBean;
import com.jz.community.moduleshoppingguide.home.bean.PreferentialBean;
import com.jz.community.moduleshoppingguide.home.bean.QueryCouponState;
import com.jz.community.moduleshoppingguide.home.bean.ShareBean;
import com.jz.community.moduleshoppingguide.nearshop.bean.GoodsInfo;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by Tony.Fan on 2018/3/13 11:43
 */
public interface ShoppingGuideReqApi {


    @GET(Constant.SHOW_GOODS_INFOES)
    Observable<GoodsInfo> showGoodsInfo(@Query("filter") String filter, @Query("page") int page, @Query("size") int size);

    /**
     * 查询首页类目
     *
     * @param cityCode
     * @param platformId
     * @return
     */
    @GET(Constant.CHUNNEL_CATEGORIES_HOME)
    Observable<List<ChunnelCategoriesBean>> getChunnelCategoriesHome(@Query("cityCode") String cityCode, @Query("platformId") String platformId);

    /**
     * 查询365类目列表
     *
     * @param categoryId
     * @param cityCode
     * @param platformId
     * @return
     */
    @GET(Constant.CHUNNEL_CATEGORIES)
    Observable<List<ChunnelTypeBean>> getChunnelCategories(@Query("categoryId") String categoryId, @Query("cityCode") String cityCode, @Query("platformId") String platformId);

    /**
     * 365根据类目Id查询所有的商品信息
     *
     * @param showCategoryId
     * @param shopId
     * @param sort
     * @param page
     * @param size
     * @return
     */
    @GET(Constant.CHANNEL_OUT_CATEGORIES)
    Observable<CategoriesGoodsBean> channelOutCategories(@Query("showCategoryId") String showCategoryId, @Query("shopId") String shopId, @Query("sort") String sort, @Query("page") int page, @Query("size") int size);

    /**
     * 根据类目Id查询所有的商品信息
     *
     * @param showCategoryId
     * @param page
     * @param size
     * @return
     */
    @GET(Constant.CHUNNEL_SHOW_CATEGORIES + "/{showCategoryId}")
    Observable<CategoriesGoodsBean> chunnelShowCategories(@Path("showCategoryId") String showCategoryId, @Query("page") int page, @Query("size") int size);

    @GET(Constant.CHUNNEL_HOME_PAGE)
    Observable<HomeFindBean> getChunnelHomePage(@QueryMap Map<String, Object> map);

    @GET(Constant.CHUNNEL_RECOMMEND)
    Observable<HomeRecommendBean> getHomeRecommend(@Query("page") int page, @Query("size") int size, @Query("platformId") String platformId);

    @GET(Constant.CHUNNEL_NEWBORN)
    Observable<ChunnelNewbornBean> getChunnelNewborn(@Query("page") int page, @Query("size") int size, @Query("appCode") String appCode);

    @POST(Constant.COUPON_RECEIVE_IDS)
    Observable<List<QueryCouponState>> couponReceiveIds(@Body RequestBody body);

    @GET(Constant.PREFERENTIAL_AREA)
    Observable<PreferentialBean> preferentialArea(@Query("page") int page, @Query("size") int size, @Query("cityCode") String cityCode, @Query("message") String message);

    @GET(Constant.TIME_LIMIT_GOODS)
    Observable<LimitGoodsBean> initGoodsData(@Query("cityId") String cityId, @Query("limitedStartTime") String startTime, @Query("limitedStopTime") String endTime, @Query("page") int page, @Query("size") int size);

    @GET(Constant.UNREAD_COUNT)
    Observable<Integer> unreadCount(@Query("type") String type);

    @GET(Constant.CHUNNEL_HOT_SALE_ALL)
    Observable<HotSaleAllBean> chunnelHotSaleAll(@Query("page") int page, @Query("size") int size, @Query("showCategoryId") String showCategoryId, @Query("platformId") String platformId, @Query("message") int message);

    @GET(Constant.CHUNNEL_HOT_SALE_SHOW)
    Observable<HotSaleShowBean> chunnelHotSaleShow(@Query("message") int message);

    @GET(Constant.SHARE_GIFT)
    Observable<ShareBean> initShareGift();

}
